import { IsArray, IsOptional, IsString, Length } from 'class-validator';
import { RoleEnum } from 'src/common/enum';

export class LoginDto {
  @Length(3, 20)
  @IsString()
  userName: string;

  @Length(6, 20)
  @IsString()
  password: string;
}

export class RegisterDto extends LoginDto {
  @IsArray()
  @IsOptional()
  roles?: RoleEnum[];
}
